﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Reflection;

namespace ValidationLibrary
{
    public class ValidationRuleResult<T>
    {
        public bool Valid { get; private set; }
        ValidationRule<T> _rule { get; set; }

        public string Message
        {
            get
            {
                return _rule._message;
            }
        }
        public IEnumerable<PropertyInfo> Properties
        {
            get
            {
                return _rule._validatedProperties.AsReadOnly();
            }
        }


        public ValidationRuleResult(bool valid, ValidationRule<T> rule)
        {
            Valid = valid;
            _rule = rule;
        }
    }
}
